﻿@model List<KnockoutJS.Web.ViewModels.CategoryViewModel>
@{ 
    var selectedCategoryId = ViewBag.SelectedCategoryId;
}

<div class="list-group">
    @foreach (var category in Model)
    {
        <a asp-action="Index" asp-controller="Book" asp-route-categoryId="@category.Id" class="list-group-item @if (selectedCategoryId == category.Id) { @Html.Raw("active")} ">@category.Name</a>
    }
</div>